package aorey.notice;

import com.alibaba.fastjson.JSONObject;

public class Message {

	public String state = "0";
	public String data = "";
	public String error = "";
	
	public String toString()
	{
		StringBuilder result = new StringBuilder();
		JSONObject jsonObject = new JSONObject();
		jsonObject.put("state", this.state);
		jsonObject.put("data", this.data);
		jsonObject.put("error", this.error);
		
		/*
		result.append("{");
		result.append("\"state\":\""+this.state+"\",");
		if (this.data.equals("")) {
			result.append("\"data\":\"\",");
		}
		else{
			result.append("\"data\":"+this.data+",");
		}
		
		result.append("\"error\":\""+this.error+"\"");
		result.append("}");
		return result.toString();
		*/
		return jsonObject.toJSONString();
	}
}
